package com.ibeetl.admin.aod.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.ibeetl.admin.aod.dao.DieImportTaskDao;
import com.ibeetl.admin.aod.entity.DieImportTask;
import com.ibeetl.admin.core.service.BaseService;

/**
 * DieImportTask Service
 */

@Service
@Transactional
public class DieImportTaskService extends BaseService<DieImportTask>{

    @Autowired private DieImportTaskDao dieImportTaskDao;

    public PageQuery<DieImportTask>queryByCondition(PageQuery query){
        PageQuery ret =  dieImportTaskDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelDieImportTask(List<Long> ids){
        try {
            dieImportTaskDao.batchDelDieImportTaskByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除DieImportTask失败", e);
        }
    }

    public DieImportTask findByBatchNo(String batchNo) {
        return dieImportTaskDao.findByBatchNo(batchNo);
    }

}